///////////////
//  by 辜勇胜 //
///////////////
#include "motor.h"
#include "Arduino.h"



// 初始化
void car_init() {

  pinMode(car_PIN_1, OUTPUT);
  pinMode(car_PIN_2, OUTPUT);
  pinMode(car_PIN_3, OUTPUT);

  digitalWrite(car_PIN_1, HIGH);
  digitalWrite(car_PIN_2, HIGH);
  digitalWrite(car_PIN_3, HIGH);
}

// 前进
void car_forward() {
  digitalWrite(car_PIN_1, LOW);
  digitalWrite(car_PIN_2, LOW);
  digitalWrite(car_PIN_3, HIGH);

}
// 左转
void car_left() {
  digitalWrite(car_PIN_1, LOW);
  digitalWrite(car_PIN_2, HIGH);
  digitalWrite(car_PIN_3, HIGH);
}
// 右转
void car_right() {

  digitalWrite(car_PIN_1, HIGH);
  digitalWrite(car_PIN_2, LOW);
  digitalWrite(car_PIN_3, HIGH);
}

// 停止
void car_stop(){
    digitalWrite(car_PIN_1, HIGH);
  digitalWrite(car_PIN_2, HIGH);
  digitalWrite(car_PIN_3, HIGH);
}
